#include <assert.h>
#include <SDL.h>
#include "Screen.h"

Screen::Screen()
{
	SDL_Init(SDL_INIT_EVERYTHING);
	m_surface = 0;
}

Screen::~Screen()
{
//	SDL_Quit();
}

bool Screen::CreateWindow(int width, int height)
{
	m_surface = SDL_SetVideoMode(width, height, 0, SDL_SWSURFACE);

	//n00b15h w4y
// 	if (m_surface != 0)
// 	{
// 		return true;
// 	}
// 	else 
// 	{
// 		false;
// 	}

	//This is the better way
	return (m_surface != 0);
}

void Screen::Flip()
{
	assert(m_surface != 0);
	SDL_Flip(m_surface);
}

SDL_Surface* Screen::GetSurface()
{
	assert(m_surface);
	return m_surface;
}